/**
 * @brief 恒温器
 */
#pragma once

#include "BridgedDevice.h"

class Thermostat: public BridgedDevice
{
public:
    static constexpr chip::DeviceTypeId kDeviceTypeThermostat = 0x0301;
    explicit Thermostat(const BasicInformation *node);

    Protocols::InteractionModel::Status ReadAttribute(
            ClusterId clusterId,
            AttributeId attributeId,
            uint8_t* buffer,
            uint16_t maxReadLength) override;

    Protocols::InteractionModel::Status WriteAttribute(
            ClusterId clusterId,
            const EmberAfAttributeMetadata* attributeMetadata,
            uint8_t* buffer) override;

    ChipError OnReport(const DataBlock* message) override;
    ChipError OnReadAttributes() override;

    ChipError AttachToIndex(uint16_t index) override;

private:
    uint16_t mLocalTemperature;
    uint16_t mCoolSetpoint;
    uint16_t mHeatSetpoint;
    uint8_t mSystemMode;
};

